From: Joey Hess Date: Thu, 4 Sep 2025 20:31:09 +0000 (-0400) Subject: more X-Git-Tag: archive/raspbian/10.20251029-1+rpi1~1^2~3^2~149 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=eff0c509f748f8d8d3e1908fff3b028579d59ce7;p=git-annex.git more --- diff --git a/Annex/Link.hs b/Annex/Link.hs index 6cef911a11..480a00ce25 100644 --- a/Annex/Link.hs +++ b/Annex/Link.hs @@ -36,6 +36,7 @@ import Utility.FileMode import Utility.InodeCache import Utility.Tmp.Dir import Utility.CopyFile +import Utility.OpenFd import qualified Database.Keys.Handle import qualified Utility.RawFilePath as R import qualified Utility.FileIO as F @@ -447,8 +448,9 @@ isPointerFile f = catchDefaultIO Nothing $ #else #if MIN_VERSION_unix(2,8,0) let open = do - fd <- openFd (fromOsPath f) ReadOnly - (defaultFileFlags { nofollow = True, cloexec = True }) + fd <- openFdWithMode (fromOsPath f) ReadOnly Nothing + (defaultFileFlags { nofollow = True }) + (CloseOnExecFlag True) fdToHandle fd in bracket open hClose readhandle #else diff --git a/doc/bugs/35_failed_tests_on_beegfs/comment_6_172a92bf49be25355dda3f88b377a6f4._comment b/doc/bugs/35_failed_tests_on_beegfs/comment_6_172a92bf49be25355dda3f88b377a6f4._comment index 4d33caa11d..8ba69239de 100644 --- a/doc/bugs/35_failed_tests_on_beegfs/comment_6_172a92bf49be25355dda3f88b377a6f4._comment +++ b/doc/bugs/35_failed_tests_on_beegfs/comment_6_172a92bf49be25355dda3f88b377a6f4._comment @@ -3,11 +3,14 @@ subject="""comment 6""" date="2025-09-04T18:24:33Z" content=""" -Note that `openFile` is not the only one that would need to be dealt with. -Also `withFile`, `openBinaryFile`, and `withBinaryFile`. +`openFile` is not the only one that would need to be dealt with. +Also `withFile`, `openBinaryFile`, `withBinaryFile`, `appendFile`, +and `openTempFile`, `readFile, and `writeFile` (including `L.` versions). -And, since none of those provide a way to set CloseOnExec, they would have -to be changed to use `openFd` with CloseOnExec, and then mkHandleFromFD. +Since none of those provide a way to set CloseOnExec, they would have +to be changed to be implemented using `openFd` with CloseOnExec, and +then mkHandleFromFD. Or rewritten to use + I have checked and none of those are ever used to create a handle that is intentionally passed to a child process. The only uses of `handleToFd` @@ -17,5 +20,7 @@ versions of all of those. Also there are a few uses of `openFd` that don't set CloseOnExec. -And possibly also some libraries might open files, I don't know. +There is also the problem that any haskell library that does anything +with a file might use any of the above internally without setting +close-on-exec. """]]